<?php
	require_once 'class/config_database.php';
	require_once 'class/kamar.php';
	$kamar_dao = new Kamar_Dao($host,$user,$pass,$dbnm);
	$kamar	   = new Kamar();
	
	$field_search = $_REQUEST['searchby'];
	switch($field_search){
	case 'location' : {
		$search 		= $_REQUEST['listlocation'];
		$list_search 	= $kamar_dao->search_location($search);
		break;
	}
		case 'price' : {
		$search 		= $_REQUEST['listprice'];
		$list_search 	= $kamar_dao->search_price($search);
		break;
	}
		case 'facility' : {
		$search 		= $_REQUEST['listfacility'];
		$list_search 	= $kamar_dao->search_facility($search);
		break;
	}
		case 'owner' : {
		$search 		= $_REQUEST['owner'];
		$list_search 	= $kamar_dao->search_owner($search);
		break;
	}
		case 'others' : {
		$search 		= $_REQUEST['other'];
		$list_search 	= $kamar_dao->search_other($search);
		break;
	}
		case 'roomspace' : {
		$search 		= $_REQUEST['listroomspace'];
		$list_search 	= $kamar_dao->search_roomspace($search);
		break;
	}
		default : {
		$pesan 		= "Anda belum memilih";
		break;
	}
	}
?>